package com.company.project.modular.system.service.impl;

import com.alibaba.dubbo.config.annotation.Reference;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.company.project.modular.system.dao.InstockMapper;
import com.company.project.modular.system.service.IStandardService;
import com.company.project.modular.system.dao.StandardMapper;
import com.company.project.modular.system.model.Standard;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lsf
 * @since 2018-10-30
 */
@Service
@Transactional
public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> implements IStandardService {

    /**
     * 查询最大的StandardLabel
     */
    @Override
    public List<Standard> findByMaxNumber(){
        return this.baseMapper.findByMaxNumber();
    }
   /* 根据id查询docId*/
    @Override
    public int findByDocId(Integer id){
        return this.baseMapper.findByDocId(id);
    }

    /*查询standard_code*/
    @Override
    public List<Standard> findByStandar(){
        return this.baseMapper.findByStandar();
    }
    @Override
    public List<String> findByStandarCode(){
        return this.baseMapper.findByStandarCode();
    }

    @Override
    public List<String> findByStandardName() {
        return this.baseMapper.findByStandardName();
    }

    @Override
    public List<Map<String, Object>> list() {
        return this.baseMapper.list();
    }

    @Override
    public List<Standard> selectByAll(@Param("useCode") String useCode) {
        return this.baseMapper.selectByAll(useCode);
    }
    /*根据standardId查询一条记录并且更新standard表,将文件表的编号存进去*/
    @Override
    public Standard findAll(@Param("id") String id) {
        return this.baseMapper.findAll(id);
    }

    @Override
    public String findByAuditName(@Param("standardCode") String standardCode) {
        return this.baseMapper.findByAuditName(standardCode);
    }

    @Override
    public List<String> findByCode12(@Param("standardType") int standardType) {
        return this.baseMapper.findByCode12(standardType);
    }

    public Standard findByCodeOne(String standardCodeOne){
        return this.baseMapper.findByCodeOne(standardCodeOne);
    }

}
